package com.linkoog.devtools.code_generator.database.sqlparser;

import com.linkoog.devtools.code_generator.database.domain.TableInfo;

import java.util.List;

public class ParseResult {

    private ParseState parseState = ParseState.SUCCESS;

    private String errorMessage;

    private List<TableInfo> tableInfos;

    public ParseState getParseState() {
        return parseState;
    }

    public ParseResult setParseState(ParseState parseState) {
        this.parseState = parseState;
        return this;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public ParseResult setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }

    public List<TableInfo> getTableInfos() {
        return tableInfos;
    }

    public void setTableInfos(List<TableInfo> tableInfos) {
        this.tableInfos = tableInfos;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("com.github.linkoog.crud.dialog.ddl.sql.parser.ParseResult{");
        sb.append("parseState=").append(parseState);
        sb.append(", errorMessage='").append(errorMessage).append('\'');
        sb.append(", tableInfo=").append(tableInfos);
        sb.append('}');
        return sb.toString();
    }
}
